from rest_framework.serializers import ModelSerializer

from stock.models import Stock, Goods, Warehouse


class StockSerializer(ModelSerializer):
    class Meta:
        model = Stock
        fields = '__all__'


class WarehouseSerializer(ModelSerializer):
    class Meta:
        model = Warehouse
        fields = '__all__'


class GoodsSerializer(ModelSerializer):
    class Meta:
        model = Goods
        fields = '__all__'

class StockDetailSerializer(ModelSerializer):
    goods = GoodsSerializer(many=False)
    ware = WarehouseSerializer(many=False)
    class Meta:
        model = Stock
        fields = '__all__'
